/*
 * $Id: DummyTransactionManager.java,v 1.3 2009/07/27 15:33:56 oliver Exp $
 * 
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.common.message.transaction.test;

import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionException;
import org.springframework.transaction.TransactionStatus;

/**
 * @author 212042764
 *
 */
public class DummyTransactionManager implements PlatformTransactionManager {

	public void commit(TransactionStatus ts) throws TransactionException {
		ts.createSavepoint();
	}

	public TransactionStatus getTransaction(TransactionDefinition td)
			throws TransactionException {
		return new DummyTransactionStatus();
	}

	public void rollback(TransactionStatus ts) throws TransactionException {
		ts.setRollbackOnly();
	}

}

class DummyTransactionStatus implements TransactionStatus {

	public boolean hasSavepoint() {
		return false;
	}

	public boolean isCompleted() {
		return false;
	}

	public boolean isNewTransaction() {
		return false;
	}

	public boolean isRollbackOnly() {
		return false;
	}

	public void setRollbackOnly() {

	}

	public Object createSavepoint() throws TransactionException {
		return null;
	}

	public void releaseSavepoint(Object arg0) throws TransactionException {

	}

	public void rollbackToSavepoint(Object arg0) throws TransactionException {
	}

}
